//
//  TitleTableViewCell.m
//  Rail
//
//  Created by hychen on 2018/3/6.
//  Copyright © 2018年 Hychen. All rights reserved.
//

#import "TitleTableViewCell.h"

@interface TitleTableViewCell ()
@property (nonatomic, strong) UILabel *titleLabel;
@end
@implementation TitleTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.titleLabel = [UILabel labelWithText:@"" textColor:Color_Hex(0x2c2c2c) font:[UIFont systemFontOfSize:18]];
        [self.contentView addSubview:self.titleLabel];
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView);
            make.left.mas_equalTo(15);
        }];
        
        [self showArrowWithImage:nil];
        [self.arrowView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.height.mas_equalTo(12);
            make.right.mas_equalTo(-15);
            make.centerY.equalTo(self.contentView);
        }];
        
        [self showBottomLineWithPaddingX:15 color:nil];
        [self.bottomLine mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.right.mas_equalTo(-15);
            make.bottom.mas_equalTo(0);
            make.height.mas_equalTo(0.5);
        }];
    }
    return self;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setTitle:(NSString *)title {
    _title = title;
    self.titleLabel.text = title;
}

@end
